import 'package:ichinesereader/models/school/SchoolAdminProfileDto.dart';
import 'package:ichinesereader/models/school/SchoolSettings.dart';

class SchoolAdmin {
  SchoolAdmin({
    this.accountEndDate,
    this.accountStartDate,
    this.blocked,
    this.blockedDate,
    this.classesInUse,
    this.createdBy,
    this.deleted,
    this.disabled,
    this.email,
    this.firstName,
    this.lastLogIn,
    this.lastLoggedIn,
    this.lastName,
    this.maxStudent,
    this.notes,
    this.objectId,
    this.paid,
    this.passwordHash,
    this.profileImageUrl,
    this.salt,
    this.school,
    this.schoolCode,
    this.schoolSettings,
    this.timeZone,
    this.timestampCreated,
    this.timestampDisabled,
    this.timestampEnabled,
    this.timestampPasswordChanged,
    this.userId,
    this.userName,
  });

  int? accountEndDate;
  int? accountStartDate;
  bool? blocked;
  int? blockedDate;
  int? classesInUse;
  String? createdBy;
  bool? deleted;
  bool? disabled;
  String? email;
  String? firstName;
  String? lastLogIn;
  int? lastLoggedIn;
  String? lastName;
  int? maxStudent;
  String? notes;
  String? objectId;
  bool? paid;
  String? passwordHash;
  String? profileImageUrl;
  String? salt;
  SchoolAdminProfileDto? school;
  String? schoolCode;
  SchoolSettings? schoolSettings;
  String? timeZone;
  int? timestampCreated;
  int? timestampDisabled;
  int? timestampEnabled;
  int? timestampPasswordChanged;
  String? userId;
  String? userName;

  factory SchoolAdmin.fromJson(Map<String, dynamic> json) => SchoolAdmin(
        accountEndDate: json["accountEndDate"],
        accountStartDate: json["accountStartDate"],
        blocked: json["blocked"],
        blockedDate: json["blockedDate"],
        classesInUse: json["classesInUse"],
        createdBy: json["createdBy"],
        deleted: json["deleted"],
        disabled: json["disabled"],
        email: json["email"],
        firstName: json["firstName"],
        lastLogIn: json["lastLogIn"],
        lastLoggedIn: json["lastLoggedIn"],
        lastName: json["lastName"],
        maxStudent: json["maxStudent"],
        notes: json["notes"],
        objectId: json["objectId"],
        paid: json["paid"],
        passwordHash: json["passwordHash"],
        profileImageUrl: json["profileImageUrl"],
        salt: json["salt"],
        school: json["school"]!=null ? SchoolAdminProfileDto.fromJson(json["school"]) : null,
        schoolCode: json["schoolCode"],
        schoolSettings: json["schoolSettings"]!=null ? SchoolSettings.fromJson(json["schoolSettings"]) : null,
        timeZone: json["timeZone"],
        timestampCreated: json["timestampCreated"],
        timestampDisabled: json["timestampDisabled"],
        timestampEnabled: json["timestampEnabled"],
        timestampPasswordChanged: json["timestampPasswordChanged"],
        userId: json["userId"],
        userName: json["userName"],
      );

  Map<String, dynamic> toJson() => {
        "accountEndDate": accountEndDate,
        "accountStartDate": accountStartDate,
        "blocked": blocked,
        "blockedDate": blockedDate,
        "classesInUse": classesInUse,
        "createdBy": createdBy,
        "deleted": deleted,
        "disabled": disabled,
        "email": email,
        "firstName": firstName,
        "lastLogIn": lastLogIn,
        "lastLoggedIn": lastLoggedIn,
        "lastName": lastName,
        "maxStudent": maxStudent,
        "notes": notes,
        "objectId": objectId,
        "paid": paid,
        "passwordHash": passwordHash,
        "profileImageUrl": profileImageUrl,
        "salt": salt,
        "school": school?.toJson(),
        "schoolCode": schoolCode,
        "schoolSettings": schoolSettings?.toJson(),
        "timeZone": timeZone,
        "timestampCreated": timestampCreated,
        "timestampDisabled": timestampDisabled,
        "timestampEnabled": timestampEnabled,
        "timestampPasswordChanged": timestampPasswordChanged,
        "userId": userId,
        "userName": userName,
      };
}

